﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.Json.Serialization;
using System.Threading.Tasks;

namespace BuddHa.Camera.Protcol.DH.Models
{
    public class ManagerDeviceTreeModel : BaseModel
    {
        public ManagerDeviceTreeModel() : base("/videoService/devicesManager/deviceTree?id={0}&nodeType={1}&typeCode={2}&page={3}&pageSize={4}", EnumRequestMethod.Post)
        {

        }
    }

    public class ManagerDeviceTreeRequest
    {
        [JsonPropertyName("id")]
        public string Id { get; set; }

        [JsonPropertyName("nodeType")]
        public int NodeType { get; set; }

        [JsonPropertyName("typeCode")]
        public string TypeCode { get; set; }

        [JsonPropertyName("page")]
        public int Page { get; set; }

        [JsonPropertyName("pageSize")]
        public int PageSize { get; set; }
    }

    public class ManagerDeviceTreeResponse
    {
        [JsonPropertyName("totalCount")]
        public int TotalCount { get; set; }

        [JsonPropertyName("nextPage")]
        public int NextPage { get; set; }

        [JsonPropertyName("results")]
        public List<Result> Results { get; set; }

        public class Result
        {
            [JsonPropertyName("domainId")]
            public int DomainId { get; set; }

            [JsonPropertyName("icon")]
            public string Icon { get; set; }

            [JsonPropertyName("nodeType")]
            public int NodeType { get; set; }

            [JsonPropertyName("id")]
            public string Id { get; set; }

            [JsonPropertyName("name")]
            public string Name { get; set; }

            [JsonPropertyName("orgType")]
            public string OrgType { get; set; }

            [JsonPropertyName("isParent")]
            public bool IsParent { get; set; }

            [JsonPropertyName("parentId")]
            public string ParentId { get; set; }

            [JsonPropertyName("orgCode")]
            public string OrgCode { get; set; }

            [JsonPropertyName("sort")]
            public int Sort { get; set; }

            [JsonPropertyName("orgSn")]
            public string OrgSn { get; set; }

            [JsonPropertyName("sn")]
            public string Sn { get; set; }

            /// <summary>
            /// 1：在线 0：离线
            /// </summary>
            [JsonPropertyName("online")]
            public string Online { get; set; }

            [JsonPropertyName("category")]
            public string Category { get; set; }

            [JsonPropertyName("deviceId")]
            public string DeviceId { get; set; }

            /// <summary>
            /// 0：非智能 1：智能
            /// </summary>
            [JsonPropertyName("intelliFlag")]
            public int IntelliFlag { get; set; }

            [JsonPropertyName("manufacturer")]
            public string Manufacturer { get; set; }

            [JsonPropertyName("subType")]
            public string SubType { get; set; }

            [JsonPropertyName("ip")]
            public string Ip { get; set; }

            [JsonPropertyName("channelId")]
            public string ChannelId { get; set; }

            /// <summary>
            /// 1:在线 0;离线
            /// </summary>
            [JsonPropertyName("status")]
            public int Status { get; set; }

            [JsonPropertyName("cameraType")]
            public string CameraType { get; set; }

            [JsonPropertyName("cameraFunctions")]
            public string CameraFunctions { get; set; }

            [JsonPropertyName("deviceCode")]
            public string DeviceCode { get; set; }


            [JsonPropertyName("channelSeq")]
            public int ChannelSeq { get; set; }

            [JsonPropertyName("channelType")]
            public string ChannelType { get; set; }

            [JsonPropertyName("gpsX")]
            public string GpsX { get; set; }

            [JsonPropertyName("gpsY")]
            public string GpsY { get; set; }

            [JsonPropertyName("UnitType")]
            public string unitType { get; set; }

            [JsonPropertyName("passId")]
            public string PassId { get; set; }

            /// <summary>
            /// 0 : 智能 1; 非智能
            /// </summary>
            [JsonPropertyName("intelliState")]
            public int IntelliState { get; set; }
        }
    }
}
